#!/usr/bin/python
#coding=utf-8

from __future__ import division, print_function
from ROOT import TCanvas, TGraph, TGraphErrors, TF1

ifile_name = 'Volt_Ampere.dat'
graph_curva = TGraph(ifile_name)
graph_curva.SetMarkerStyle(2)
func_curva = TF1('curva_caratteristica', '(exp([1]*x)-1)*[0] + x/1e1', -17, 1)
func_curva.SetParameters(24e-3, 1) 
graph_curva.Fit(func_curva, 'l', '', -17, 1)
graph_curva.Draw('ap')
input()
